import datetime
import time

def ToNumber( str ):
	number = 10
	if (str == "Jan"):
		number = 1
	elif (str == "Feb"):
		number = 2
	elif (str == "Mar"):
		number = 3
	elif (str == "Apr"):
		number = 4	
	elif (str == "May"):
		number = 5
	elif (str == "Jun"):
		number = 6
	elif (str == "Jul"):
		number = 7
	elif (str == "Aug"):
		number = 8	
	elif (str == "Sept"):
		number = 9
	elif (str == "Oct"):
		number = 10
	elif (str == "Nov"):
		number = 11	
	elif (str == "Dec"):
		number = 12

	return  number

def ToDateTime( yearStr, dateTimeStr ):
    return datetime.datetime.strptime(yearStr+" "+ dateTimeStr, "%Y %b %d %H:%M:%S")
    #print(dateTimeStr )
    arr = dateTimeStr.split(' ')
    #print(len(timeArr))
    #print(timeArr[0])
    yearStr += "-"+str(ToNumber( arr[0] ))+"-"+arr[1]+" "+arr[2]
    return datetime.datetime.strptime(yearStr, "%Y-%m-%d %H:%M:%S")
		

	
	
f = open('all1.txt', encoding="utf-8")

line1 = f.readline()
while(line1):
    line1Arr = line1.split('\t')
    #print(len(arr))
    time1 =ToDateTime( "2018", line1Arr[1] )
    #print(time1)
    line2 = f.readline()
    if(line2):
        line2Arr = line2.split('\t')
        time2 =ToDateTime( "2018", line2Arr[1] )

        #print(type(time2  - time1) )
        if((time2  - time1).total_seconds() > 10 ):
            print(time2)
    
    line1 = line2


##f = open('all1.txt', encoding="utf-8")
##res = {}
##for l in f:
##    arr = l.split(' ')
##    ip = arr[0]
##    url = arr[6]
##    status = arr[7]
##    res[(ip,url,status)] = res.get((ip,url,status),0)+1
##res_list = [(k[0],k[1],k[2],v) for k,v in res.items()]
##
##for k in sorted(res_list,key=lambda x:x[3],reverse=True)[:10]:
##    print(k)


##一月份＝JAN.   Jan.=January
##二月份＝FEB.   Feb.=February
##三月份＝MAR.   Mar.=March
##四月份＝APR.   Apr.=April
##五月份＝MAY    May=May
##六月份＝JUN.   Jun.=June
##七月份＝JUL.   Jul.=July
##八月份＝AUG.   Aug.=August
##九月份＝SEP.   Sept.=September
##十月份＝OCT.   Oct.=October
##十一月份＝NOV. Nov.=November
##十二月份＝DEC. Dec.=December


	
